<?php
/**
 * 测试文件
 */

require_once 'Room.php';        //房间管理类
require_once 'RoomDetail.php';  //房间明细类
require_once 'Player.php';      //玩家类

//------------------------------顽疾类测试--------------------------------------
$Player1 = new Player(['PlayerId' => 1001, 'PlayerName' => '用户1001', 'PlayerHeaderImg' => '测试图片1', 'PlayerCredits' => 1]); //玩家1
$Player2 = new Player(['PlayerId' => 1002, 'PlayerName' => '用户1002', 'PlayerHeaderImg' => '测试图片2', 'PlayerCredits' => 1]); //玩家2
$Player3 = new Player(['PlayerId' => 1003, 'PlayerName' => '用户1003', 'PlayerHeaderImg' => '测试图片3', 'PlayerCredits' => 1]); //玩家3
var_dump($Player1->getPlayerDetail()); //获取玩家1信息详情 并打印
echo $Player1->getPlayerId();          //获取玩家1 ID 并打印
echo "\r\n";                           //换行

//------------------------------房间明细类测试--------------------------------------
$RoomDetail = new RoomDetail(1);         //创建房间
$message = $RoomDetail->playerJoin($Player1->getPlayerId(), $Player1->getPlayerDetail());      //玩家加入房间
var_dump($message);
$playeList = $RoomDetail->playerList();//房间内玩家列表
var_dump($playeList);
$res = $RoomDetail->playerOut($Player1->getPlayerId());//玩家离开房间
var_dump($res);//游戏开始
$res1 = $RoomDetail->playerReady($Player1->getPlayerId());
var_dump($res1);
$res2 = $RoomDetail->playerVote($Player1->getPlayerId());//房间投票
var_dump($res2);
